# -*- encoding:utf-8 -*-
from mako import runtime, filters, cache
UNDEFINED = runtime.UNDEFINED
__M_dict_builtin = dict
__M_locals_builtin = locals
_magic_number = 5
_modified_time = 1291537621.0375509
_template_filename='/Users/joeldunham/old/onlinelinguisticdatabase/templates/derived/tag/index.html'
_template_uri='/derived/tag/index.html'
_template_cache=cache.Cache(__name__, _modified_time)
_source_encoding='utf-8'
from webhelpers.html import escape
_exports = ['heading', 'displayTags']


def _mako_get_namespace(context, name):
    try:
        return context.namespaces[(__name__, name)]
    except KeyError:
        _mako_generate_namespaces(context)
        return context.namespaces[(__name__, name)]
def _mako_generate_namespaces(context):
    pass
def _mako_inherit(template, context):
    _mako_generate_namespaces(context)
    return runtime._inherit_from(context, u'/base/index.html', _template_uri)
def render_body(context,**pageargs):
    context.caller_stack._push_frame()
    try:
        __M_locals = __M_dict_builtin(pageargs=pageargs)
        self = context.get('self', UNDEFINED)
        c = context.get('c', UNDEFINED)
        __M_writer = context.writer()
        # SOURCE LINE 1
        __M_writer(u'\n\n')
        # SOURCE LINE 5
        __M_writer(u'\n\n')
        # SOURCE LINE 7
        __M_writer(escape(self.displayTags(
    'Keywords',
    'keywords',
    c.keywords,
    "Keywords can be associated to a Form.  Add, modify or delete keywords " + \
    "here.  Just be careful when renaming or deleting a keyword: this " + \
    "could have unwanted effects on associated Forms.",
    'key',
    None
)))
        # SOURCE LINE 16
        __M_writer(u'\n\n')
        # SOURCE LINE 18
        __M_writer(escape(self.displayTags(
    'Syntactic Categories',
    'categories',
    c.syncats,
    "A (morpho-)syntactic category can be associated to a Form.  Add, " + \
    "modify or delete syntactic categories here.  Again, consider " + \
    "carefully before renaming or deleting a keyword as this could have " + \
    "unwanted effects on any associated Forms.",
    'category'
)))
        # SOURCE LINE 27
        __M_writer(u'\n\n')
        # SOURCE LINE 29
        __M_writer(escape(self.displayTags(
    'Elicitation Methods',
    'methods',
    c.elicitationMethods,
    "An elicitation method can be associated to a Form.  Add, modify or " + \
    "delete elicitation methods here.  The same warnings apply as above.",
    'method'
)))
        # SOURCE LINE 36
        __M_writer(u'\n\n\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_heading(context):
    context.caller_stack._push_frame()
    try:
        __M_writer = context.writer()
        # SOURCE LINE 3
        __M_writer(u'\n<h1 class="heading">Keywords</h1>\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


def render_displayTags(context,tagName,anchor,tags,descriptorParagraph,controllerName,header=1):
    context.caller_stack._push_frame()
    try:
        url = context.get('url', UNDEFINED)
        __M_writer = context.writer()
        # SOURCE LINE 40
        __M_writer(u'\n\n')
        # SOURCE LINE 42
        if header:
            # SOURCE LINE 43
            __M_writer(u"        <a name='")
            __M_writer(escape(anchor))
            __M_writer(u'\'</a>\n        <div class="tableSpacerDivHalf"></div>\n        <h1 class="heading">')
            # SOURCE LINE 45
            __M_writer(escape(tagName))
            __M_writer(u'</h1>\n')
            pass
        # SOURCE LINE 47
        __M_writer(u'    \n    <p class="descriptiveP">')
        # SOURCE LINE 48
        __M_writer(escape(descriptorParagraph))
        __M_writer(u'</p>\n    \n    ')
        # SOURCE LINE 50
        title="Add new %s" % tagName 
        
        __M_writer(u'\n    \n    <a href="')
        # SOURCE LINE 52
        __M_writer(escape(url(controller=controllerName, action='add')))
        __M_writer(u'" ')
        # SOURCE LINE 53
        __M_writer(u'       class="buttonLink" title="')
        __M_writer(escape(title))
        __M_writer(u'">Add</a>\n    \n    <div class="containerDiv">\n')
        # SOURCE LINE 56
        if tags:
            # SOURCE LINE 57
            __M_writer(u'        <table class="clearTable">\n            <thead>\n                <tr>\n                    <td class="tagIDCell">ID</td>\n                    <td class="tagNameCell">Name</td>\n                    <td class="tagDescriptionCell">Description</td>\n                </tr>\n            </thead>\n    \n')
            # SOURCE LINE 66
            for tag in tags:
                # SOURCE LINE 67
                __M_writer(u'            <tr>\n                <td class="clearTable">')
                # SOURCE LINE 68
                __M_writer(escape(tag.id))
                __M_writer(u'</td>\n                <td><a href="')
                # SOURCE LINE 69
                __M_writer(escape(url(controller=controllerName, action='view', \
                            id=tag.id)))
                # SOURCE LINE 70
                __M_writer(u'" class="link">')
                __M_writer(escape(tag.name))
                __M_writer(u'</a></td>\n                <td>')
                # SOURCE LINE 71
                __M_writer(escape(tag.description))
                __M_writer(u'</td>\n            </tr>\n')
                pass
            # SOURCE LINE 74
            __M_writer(u'    \n        </table>\n')
            pass
        # SOURCE LINE 77
        __M_writer(u'    \n    </div>\n\n')
        return ''
    finally:
        context.caller_stack._pop_frame()


